<?php
	class Dispatcher {
		
		public function dispatch(Request $request, Router $router) {
			$router->parseUrl($request->getUrl());
			$controller = $this->_invokeController($router->getController());
			$controller->invokeAction($router->getAction(), $router->getParams());
					
		}
		
		private function _invokeController($controller) {
			return new $controller;
		}
		
	}